import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Rooks {
   private void run() throws Exception {
       int bino [][] = new int [11][11]; 
       int fact [] = new int [11];
       for(int i=0;i<=10;++i) {
           bino[i][0]=bino[i][i]=1 ; fact[i] = (i-1>=0?fact[i-1]*i:1); 
           for(int j=1;j<i;++j) bino[i][j] = bino[i-1][j-1]+bino[i-1][j];
       }
       BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
       StringTokenizer st = new StringTokenizer(bf.readLine());
       int n = Integer.parseInt(st.nextToken());
       int k = Integer.parseInt(st.nextToken());
       if(k>n) System.out.println(0); 
       else System.out.println(bino[n][k]*bino[n][k]*fact[k]);

   }
   public static void main ( String [] Args ) throws Exception { 
        new Rooks().run();
   }
}
